package entry;

import static org.junit.Assert.*;

import org.junit.Test;

public class EntryTest {

	@Test
	public void compareTest_less() {
		Entry entryLower = createNewEntry("abbr", "ext", "descr");
		Entry entryGreater = createNewEntry("skrot", "wyjasnienie", "opis");
		assertTrue(entryLower.compareTo(entryGreater) < 0);
	}
	
	@Test
	public void compareTest_greater() {
		Entry entryLower = createNewEntry("abbr", "ext", "descr");
		Entry entryGreater = createNewEntry("skrot", "wyjasnienie", "opis");
		assertTrue(entryGreater.compareTo(entryLower) > 0);
	}
	
	@Test
	public void compareTest_equal() {
		Entry entryOne = createNewEntry("abbr", "ext", "descr");
		Entry entryTwo = createNewEntry("abbr", "wyjasnienie", "opis");
		assertTrue(entryTwo.compareTo(entryOne) == 0);
	}

	private Entry createNewEntry(String string, String string2, String string3) {
		Entry e = new Entry();
		e.setAbbr(string);
		e.setExtension(string2);
		e.setDescription(string3);
		return e;
	}

}
